<%@page import="java.util.ArrayList"%>
<%@page import="cn.edu.thsis.pojo.newsinfo"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>公告列表</title>
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/font-awesome.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInUp">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>所有公告</h5>
                    <div class="ibox-tools">
                        <a href="admin/admin_news.jsp" class="btn btn-primary btn-xs">创建新公告</a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="project-list">
                        <table class="table table-hover">
                            <tbody>
                            <%
                             List<newsinfo> niList = (ArrayList<newsinfo>)request.getAttribute("niList");
                            for(newsinfo ni :niList){
                            %>
                            <tr>
                                <td class="project-title">
                                    <a href="${pageContext.request.contextPath}/NewsInfo?oper=news&nid=<%=ni.getNid() %>"><%=ni.getTitle() %></a>
                                    <br/>
                                    <small>创建于<small><%out.print(ni.getCreateDate()); %></small></small>
                                </td>
                                <td class="project-actions">
                                    <a href="${pageContext.request.contextPath}/NewsInfo?oper=news&nid=<%=ni.getNid() %>" class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </a>
                                    <a href="#" class="btn btn-white btn-sm"><i class="fa fa-pencil"></i> 编辑 </a>
                                    <a href="${pageContext.request.contextPath}/NewsInfo?oper=newdel&nid=<%=ni.getNid() %>" class="btn btn-white btn-sm"><i class="fa fa-pencil"></i> 删除 </a>
                                </td>
                            </tr>
                            <%} %>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/js/content.js"></script>
</body>
</html>
